package com.example.feignconsumer.service;

import com.example.api.domain.Person;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 服务接口，接口名称不区分大小写。
 * @date 2019-4-18 14:56:10
 * @author joker
 */
@FeignClient("hello-service")
public interface HelloService {

    /**
     * 测试接口
     * @return String
     */
    @RequestMapping("/eureka/client/hello")
    String hello();

    /**
     * requestParam
     * @param name 姓名
     * @return String
     */
    @GetMapping("/eureka/client/hello1")
    String hello(@RequestParam("name") String name);

    /**
     * requestHeader
     * @param name 姓名
     * @param age 年龄
     * @return String
     */
    @GetMapping("/eureka/client/hello2")
    String hello(@RequestHeader("name") String name, @RequestHeader("age") Integer age);

    /**
     * requestBody
     * @param person 用户
     * @return String
     */
    @PostMapping("/eureka/client/hello3")
    String hello(@RequestBody Person person);

}
